#!/usr/bin/env python
# -*- coding: utf-8 -*-
# @Time    : 2024/4/1 20:42
# @Author : 闫峰
# @File    : popChoiceDetailmodel.py
from pydantic import BaseModel
from typing import List, Optional


class ChoiceSkuPrice(BaseModel):
    nation_name: Optional[str]
    price: Optional[str]


class ChoiceSkuPriceObi(BaseModel):
    choice_sku_price: Optional[List[ChoiceSkuPrice]]


class PopChoiceProductSkuScItemInfo(BaseModel):
    sc_item_code: Optional[str] #—————变体SKU 货品编码
    sc_item_bar_code: Optional[str] # —————变体SKU 货品条码
    sc_item_id: Optional[int] # —————变体SKU 货品id
    original_box: Optional[str]#—————变体SKU是否原箱


class PopChoiceSkuWarehouse(BaseModel):
    warehouse_name: Optional[str] #—————变体SKU JIT仓库名称
    sellable_quantity: Optional[int] #—————变体SKU 可售数
    warehouse_code: Optional[str] # —————变体SKU JIT仓库编码


class PopChoiceSkuWarehouseStock(BaseModel):
    pop_choice_sku_warehouse_stock: Optional[List[PopChoiceSkuWarehouse]]


class FreightFee(BaseModel):
    price: Optional[str]  #—————变体SKU国家区域化运费
    nation_code: Optional[str]


class FreightFeelist(BaseModel):
    freight_fee: Optional[List[FreightFee]]


class SkuProperty(BaseModel):
    sku_property_value: Optional[str]
    property_value_id_long: Optional[int]
    sku_property_id_long: Optional[int]
    sku_property_name: Optional[str]
    property_value_definition_name: Optional[str]
    sku_image: Optional[str]


class Skuproperty(BaseModel):
    sku_property: Optional[List[SkuProperty]]


class ProductSku(BaseModel):
    package_weight: Optional[str]
    package_height: Optional[str]
    package_width: Optional[str]
    package_length: Optional[str]
    sku_id: Optional[str] #—————平台SKU_ID
    sku_code: Optional[str] #产品币种
    base_price: Optional[str] #—————变体SKU供货价（裸价）
    choice_sku_price_list: Optional[ChoiceSkuPriceObi]  # —————变体SKU国家区域化售价
    pop_choice_product_sku_sc_item_info: Optional[PopChoiceProductSkuScItemInfo]
    pop_choice_sku_warehouse_stock_list: Optional[PopChoiceSkuWarehouseStock]
    freight_fee_list: Optional[FreightFeelist]
    sku_property_list: Optional[Skuproperty]
    product_id: Optional[int]  # 产品id
    category_id: Optional[int] #类目id


class ProductSkuList(BaseModel):
    product_sku: Optional[List[ProductSku]]


class JoinCountryList(BaseModel):
    joined_country: Optional[List[str]]


class PopDetail(BaseModel):
    """
    POP 速卖通半托产品详情
    """
    joined_country_list: Optional[JoinCountryList]  # 该商品下已勾选参与的国家列表
    product_sku_list: Optional[ProductSkuList]  # 该半托管商品下SKU列表
    product_id: Optional[int]  # 半托管商品id
    currency_code: Optional[str]  # 货币码
    category_id: Optional[int]  # 类目id